Skip to content

pkg/rhsm: use Katello CA as default on Satellite hosts - #2613

Merged
supakeen merged 1 commit into
osbuild:mainfrom
lzap:sat-37848-katello-ca
Aug 27, 2026
Merged

pkg/rhsm: use Katello CA as default on Satellite hosts#2613
supakeen merged 1 commit into
osbuild:mainfrom
lzap:sat-37848-katello-ca

Conversation

@lzap

@lzap lzap commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

On Satellite-registered hosts, content is served through the Satellite content proxy whose TLS certificate is signed by the Katello CA. The default redhat-uep.pem only contains the Red Hat CDN CA and cannot validate these certificates, causing TLS failures when fetching packages from RHSM-backed repositories.

When /etc/rhsm/ca/katello-server-ca.pem exists (installed by the Satellite registration process), use it as the default CA. This single-point fix works transparently across all download backends (curl, librepo, dnf) since they all read the default CA from the same Subscriptions class. When a repo file explicitly sets sslcacert, that value still takes precedence.

A hybrid approach combining the RHSM CA and the system CA bundle was rejected because the three download backends configure CA certs differently (librepo has no LRO_SSLCAPATH, dnf does not expose sslcapath), making a reliable cross-backend setup fragile and hard to test.

Mirrors osbuild PR osbuild/osbuild#2537.

Jira: https://redhat.atlassian.net/browse/SAT-37848

🤖 Generated with Claude Code

@lzap
lzap requested a review from a team as a code owner August 24, 2026 07:31
Comment thread pkg/rhsm/secrets.go
if _, err := os.Stat(katelloCACert); err == nil {
return katelloCACert
}
return "/etc/rhsm/ca/redhat-uep.pem"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe make both consts and swap between them? I dunno, stylistic only.

Comment thread pkg/rhsm/secrets_test.go
assert.Equal(t, "/etc/rhsm/ca/redhat-uep.pem", defaultCACert())

// Katello CA present: prefer it.
present := filepath.Join(t.TempDir(), "katello-server-ca.pem")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't matter but why an additional present var here, can't it just assign directly to katelloCACert?

On Satellite-registered hosts, content is served through the Satellite
content proxy whose TLS certificate is signed by the Katello CA. The
default redhat-uep.pem only contains the Red Hat CDN CA and cannot
validate these certificates, causing TLS failures when fetching packages
from RHSM-backed repositories.

When /etc/rhsm/ca/katello-server-ca.pem exists (installed by Satellite
registration), use it as the default CA. This single-point fix works
across all download backends (curl, librepo, dnf) since they all read the
default CA from the same Subscriptions class. A repo's explicit sslcacert
still takes precedence.

A hybrid approach combining the RHSM CA and the system CA bundle was
rejected because the three download backends configure CA certs
differently (librepo has no LRO_SSLCAPATH, dnf does not expose
sslcapath), making a reliable cross-backend setup fragile.

Mirrors osbuild PR osbuild#2537.

SAT-37848

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

@lucasgarfield lucasgarfield left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. I would add to the merge queue but will wait for you to choose whether or not to address @supakeen's small issues, @lzap.

@supakeen
supakeen added this pull request to the merge queue Aug 27, 2026
@supakeen

Copy link
Copy Markdown
Member

No need to wait on my nitpicks

Merged via the queue into osbuild:main with commit 927ef88 Aug 27, 2026
52 of 54 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants